<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let i = 0
        for(i = 0;i<10;i++){
            setTimeout(function(){
                console.log(i)
                i++
            },4000)
        }
        console.log(i)
    </script>
</head>
<body>
    
</body>
</html>